package com.zygh.lz.controller;

/**
 * @author lee
 */

import com.zygh.lz.entity.duty.DutyModel;
import com.zygh.lz.entity.duty.DutyPost;
import com.zygh.lz.service.DutyService;
import com.zygh.lz.stapprove.SysPcLog;
import com.zygh.lz.vo.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "勤务岗位接口")
@RestController
@RequestMapping("/duty")
public class DutyController {
    @Resource
    private DutyService dutyService;

    @GetMapping("/model")
    @ApiOperation("查询岗位下的模式")
    public ResultBean model(DutyModel dutyModel) {
        return dutyService.model(dutyModel);
    }

    @PostMapping("/model/delete")
    @ApiOperation("删除模式")
    //@SysPcLog(module = "删除模式",operation = "删除")
    public ResultBean modelDelete(@RequestBody DutyModel dutyModel) {
        return dutyService.modelDelete(dutyModel);
    }

    @GetMapping("/post")
    @ApiOperation("查询岗位")
    public ResultBean post(DutyPost dutyPost) {
        return dutyService.post(dutyPost);
    }

    @GetMapping("/post/all")
    @ApiOperation("查询所有岗位")
    public ResultBean postAll(DutyPost dutyPost) {
        return dutyService.postAll(dutyPost);
    }

    @GetMapping("/model/by/post/code")
    @ApiOperation("回显绑定的模式")
    public ResultBean modelByPostCode(Integer postCode) {
        return dutyService.modelByPostCode(postCode);
    }

    @PostMapping("/post/add")
    @ApiOperation("新增岗位接口")
    //@SysPcLog(module = "新增岗位",operation = "新增")
    public ResultBean postAdd(@RequestBody DutyPost dutyPost) {
        return dutyService.postAdd(dutyPost);
    }

    @PostMapping("/post/update")
    @ApiOperation("修改岗位信息")
    //@SysPcLog(module = "修改岗位信息",operation = "修改")
    public ResultBean postUpdate(@RequestBody DutyPost dutyPost) {
        return dutyService.postUpdate(dutyPost);
    }

    @PostMapping("/post/delete")
    @ApiOperation("删除岗位信息")
    //@SysPcLog(module = "删除岗位信息",operation = "删除")
    public ResultBean postDelete(@RequestBody DutyPost dutyPost) {
        return dutyService.postDelete(dutyPost);
    }

    @PostMapping("/model/add")
    @ApiOperation("新增模式")
    //@SysPcLog(module = "新增模式",operation = "新增")
    public ResultBean modelAdd(@RequestBody DutyModel dutyModel) {
        return dutyService.modelAdd(dutyModel);
    }

    @PostMapping("/model/update")
    @ApiOperation("修改模式信息")
    //@SysPcLog(module = "修改模式信息",operation = "修改")
    public ResultBean modelUpdate(@RequestBody DutyModel dutyModel) {
        return dutyService.modelUpdate(dutyModel);
    }

    @GetMapping("/post/id")
    @ApiOperation("查看非必填必填选项")
    public ResultBean postId(DutyPost dutyPost) {
        return dutyService.postId(dutyPost);
    }

    @GetMapping("/findDutyModeAll")
    @ApiOperation("岗位类型列表")
    public ResultBean findDutyModeAll() {
        return dutyService.findDutyModeAll();
    }


}
